package com.zy.testspringboot.demo;

import org.apache.commons.lang.StringEscapeUtils;
import org.junit.Test;

import java.io.UnsupportedEncodingException;

public class test1 {


    String beforeStr = "adddgdgert3bggd";

    String afterStr = StringEscapeUtils.unescapeJava(beforeStr);


//    public static void main(String[] args) {
//        String s = "???????????????";
//
//        String[] split = s.split("?");
//
//
//        for (int i = 0; i < split.length; i++) {
//            System.out.println(split[i]);
//
//        }
////        String s2 = StringEscapeUtils.unescapeJava(s);
////        System.out.println(s);
////        System.out.println(s2);
//    }


    @Test
    public void demo1() {
        String s = "CN=师傅的说法/OU=的方式的发生/OU=电饭锅电饭锅/O=ddfdf";
        String s1 = (s.split("O=")[0] + s.split("O=")[1]).split("CN=")[1];
        System.out.println("s1======="+s1);
        String[] split = s1.split("OU=");
        String a="";
        for (int i = 0; i < split.length; i++) {
            a+=split[i];
           // System.out.println(a);
        }
        String[] split1 = a.split("/");
        for (int i1 = 0; i1 < split1.length; i1++) {
            try {
                String s2=new String(split1[i1].getBytes("GBK"),"UTF-8");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
            System.out.println("截取后的    "+split1[i1]);
        }
    }

    public static void main(String[] args) {
        System.out.println("hello");
    }

}
